import java.util.Scanner;
public class length{
    public static void main(String[] args){
        try(Scanner sc = new Scanner(System.in)){
            System.out.println("请输入长方形的长：");
            double num1 = sc.nextDouble();

            System.out.println("请输入长方形的宽：");
            double num2 = sc.nextDouble();

            System.out.print("一个长宽分别为" + num1 + "和" + num2 + "的长方形周长为");
            getlength(num1,num2);
        }
    }
    public static void getlength(double length,double width){
        double result = (length + width) * 2;
        System.out.println(result);
    }
}